package com.ruoyi.hqfinance.service.impl;

import com.github.pagehelper.PageHelper;
import com.ruoyi.hqfinance.domain.HqTransferDetail;
import com.ruoyi.hqfinance.domain.vo.HqTransferDetailVo;
import com.ruoyi.hqfinance.mapper.HqTransferDetailMapper;
import com.ruoyi.hqfinance.service.HqTransferDetailService;
import com.ruoyi.logistic.domain.PageDate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HqTransferDetailServiceImpl implements HqTransferDetailService {
    @Autowired
    private HqTransferDetailMapper hqTransferDetailMapper;

    @Override
    public List<HqTransferDetail> selectAll(PageDate pageDate) {
        PageHelper.startPage(pageDate);
        return hqTransferDetailMapper.selectAll();
    }

    @Override
    public Boolean insert(HqTransferDetail hqTransferDetail) {
        return hqTransferDetailMapper.insert(hqTransferDetail);
    }

    @Override
    public Boolean update(HqTransferDetail hqTransferDetail) {
        return hqTransferDetailMapper.update(hqTransferDetail);
    }

    @Override
    public Boolean deleteById(Integer id) {
        return hqTransferDetailMapper.deleteById(
               id
        );
    }

    @Override
    public List<HqTransferDetail> search(HqTransferDetailVo vo) {
        PageHelper.startPage(vo.getPageDate());
        return hqTransferDetailMapper.search(vo);
    }
}
